home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-pppext-hdlc-framing-01.txt < prev    next >
Text File  |  1993-08-13  |  37KB  |  1,158 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                        W A Simpson
  8. Internet Draft                                                Daydreamer
  9. expires in six months                                        August 1993
  10.  
  11.  
  12.                             PPP HDLC Framing
  13.  
  14.  
  15.  
  16. Status of this Memo
  17.  
  18.    This document is the product of the Point-to-Point Protocol Working
  19.    Group of the Internet Engineering Task Force (IETF).  Comments should
  20.    be submitted to the ietf-ppp@ucdavis.edu mailing list.
  21.  
  22.    Distribution of this memo is unlimited.
  23.  
  24.    This document is an Internet Draft.  Internet Drafts are working
  25.    documents of the Internet Engineering Task Force (IETF), its Areas,
  26.    and its Working Groups.  Note that other groups may also distribute
  27.    working documents as Internet Drafts.
  28.  
  29.    Internet Drafts are draft documents valid for a maximum of six
  30.    months.  Internet Drafts may be updated, replaced, or obsoleted by
  31.    other documents at any time.  It is not appropriate to use Internet
  32.    Drafts as reference material or to cite them other than as a
  33.    ``working draft'' or ``work in progress.''
  34.  
  35.    Please check the 1id-abstracts.txt listing contained in the
  36.    internet-drafts Shadow Directories on nic.ddn.mil, nnsc.nsf.net,
  37.    nic.nordu.net, ftp.nisc.sri.com, or munnari.oz.au to learn the
  38.    current status of any Internet Draft.
  39.  
  40. Abstract
  41.  
  42.    The Point-to-Point Protocol (PPP) [1] provides a standard method for
  43.    transporting multi-protocol datagrams over point-to-point links.
  44.  
  45.    This document describes the use of HDLC for framing PPP encapsulated
  46.    packets.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Simpson                  expires in six months                  [Page i]
  59. DRAFT                         PPP Framing                    August 1993
  60.  
  61.  
  62. 1.  Introduction
  63.  
  64.    This specification provides for framing over both bit-oriented and
  65.    octet-oriented synchronous links, and asynchronous links with 8 bits
  66.    of data and no parity.  These links MUST be full-duplex, but MAY be
  67.    either dedicated or circuit-switched.  PPP uses HDLC as a basis for
  68.    the framing.
  69.  
  70.    An escape mechanism is specified to allow control data such as
  71.    XON/XOFF to be transmitted transparently over the link, and to remove
  72.    spurious control data which may be injected into the link by
  73.    intervening hardware and software.
  74.  
  75.    Some protocols expect error free transmission, and either provide
  76.    error detection only on a conditional basis, or do not provide it at
  77.    all.  PPP uses the HDLC Frame Check Sequence for error detection.
  78.    This is commonly available in hardware implementations, and a
  79.    software implementation is provided.
  80.  
  81.  
  82. 1.1.  Specification of Requirements
  83.  
  84.    In this document, several words are used to signify the requirements
  85.    of the specification.  These words are often capitalized.
  86.  
  87.    MUST      This word, or the adjective "required", means that the
  88.              definition is an absolute requirement of the specification.
  89.  
  90.    MUST NOT  This phrase means that the definition is an absolute
  91.              prohibition of the specification.
  92.  
  93.    SHOULD    This word, or the adjective "recommended", means that there
  94.              may exist valid reasons in particular circumstances to
  95.              ignore this item, but the full implications must be
  96.              understood and carefully weighed before choosing a
  97.              different course.
  98.  
  99.    MAY       This word, or the adjective "optional", means that this
  100.              item is one of an allowed set of alternatives.  An
  101.              implementation which does not include this option MUST be
  102.              prepared to interoperate with another implementation which
  103.              does include the option.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. Simpson                  expires in six months                  [Page 1]
  114. DRAFT                         PPP Framing                    August 1993
  115.  
  116.  
  117. 1.2.  Terminology
  118.  
  119.    This document frequently uses the following terms:
  120.  
  121.    datagram  The unit of transmission in the network layer (such as IP).
  122.              A datagram may be encapsulated in one or more packets
  123.              passed to the data link layer.
  124.  
  125.    frame     The unit of transmission at the data link layer.  A frame
  126.              may include a header and/or a trailer, along with some
  127.              number of units of data.
  128.  
  129.    packet    The basic unit of encapsulation, which is passed across the
  130.              interface between the network layer and the data link
  131.              layer.  A packet is usually mapped to a frame; the
  132.              exceptions are when data link layer fragmentation is being
  133.              performed, or when multiple packets are incorporated into a
  134.              single frame.
  135.  
  136.    peer      The other end of the point-to-point link.
  137.  
  138.    silently discard
  139.              This means the implementation discards the packet without
  140.              further processing.  The implementation SHOULD provide the
  141.              capability of logging the error, including the contents of
  142.              the silently discarded packet, and SHOULD record the event
  143.              in a statistics counter.
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. Simpson                  expires in six months                  [Page 2]
  169. DRAFT                         PPP Framing                    August 1993
  170.  
  171.  
  172. 2.  Physical Layer Requirements
  173.  
  174.    PPP is capable of operating across most DTE/DCE interfaces (such as,
  175.    EIA RS-232-C, EIA RS-422, EIA RS-423 and CCITT V.35).  The only
  176.    absolute requirement imposed by PPP is the provision of a full-duplex
  177.    circuit, either dedicated or circuit-switched, which can operate in
  178.    either an asynchronous (start/stop), bit-synchronous, or octet-
  179.    synchronous mode, transparent to PPP Data Link Layer frames.
  180.  
  181.    Interface Format
  182.  
  183.       PPP presents an octet interface to the physical layer.  There is
  184.       no provision for sub-octets to be supplied or accepted.
  185.  
  186.    Transmission Rate
  187.  
  188.       PPP does not impose any restrictions regarding transmission rate,
  189.       other than that of the particular DTE/DCE interface.
  190.  
  191.    Control Signals
  192.  
  193.       PPP does not require the use of control signals, such as Request
  194.       To Send (RTS), Clear To Send (CTS), Data Carrier Detect (DCD), and
  195.       Data Terminal Ready (DTR).
  196.  
  197.       When available, using such signals can allow greater functionality
  198.       and performance.  In particular, such signals SHOULD be used to
  199.       signal the Up and Down events in the LCP Option Negotiation
  200.       Automaton [1].  When such signals are not available, the
  201.       implementation MUST signal the Up event to LCP upon
  202.       initialization, and SHOULD NOT signal the Down event.
  203.  
  204.       Because signalling is not required, the physical layer MAY be
  205.       decoupled from the data link layer, hiding the transient details
  206.       of the physical transport.  This has implications for mobility in
  207.       cellular radio networks, and other rapidly switching links.
  208.  
  209.       When moving from cell to cell within the same zone, an
  210.       implementation MAY choose to treat the entire zone as a single
  211.       link, even though transmission is switched among several
  212.       frequencies.  The link is considered to be with the central
  213.       control unit for the zone, rather than the individual cell
  214.       transceivers.  However, the link SHOULD re-establish its
  215.       configuration whenever the link is switched to a different
  216.       administration.
  217.  
  218.       Due to the bursty nature of data traffic, some implementations
  219.       have choosen to disconnect the physical layer during periods of
  220.  
  221.  
  222.  
  223. Simpson                  expires in six months                  [Page 3]
  224. DRAFT                         PPP Framing                    August 1993
  225.  
  226.  
  227.       inactivity, and reconnect when traffic resumes, without informing
  228.       the data link layer.  Robust implementations should avoid using
  229.       this trick over-zealously, since the price for decreased setup
  230.       latency is decreased security.  Implementations SHOULD signal the
  231.       Down event whenever "significant time" has elapsed since the link
  232.       was disconnected.  The value for "significant time" is a matter of
  233.       considerable debate, and is based on the tariffs, call setup
  234.       times, and security concerns of the installation.
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278. Simpson                  expires in six months                  [Page 4]
  279. DRAFT                         PPP Framing                    August 1993
  280.  
  281.  
  282. 3.  The Data Link Layer
  283.  
  284.    PPP uses the principles, terminology, and frame structure of the
  285.    International Organization For Standardization's (ISO) 3309-1979
  286.    High-level Data Link Control (HDLC) frame structure [2], as modified
  287.    by "Addendum 1: Start/stop transmission" [3], which specifies
  288.    modifications to allow HDLC use in asynchronous environments.
  289.  
  290.    The PPP control procedures use the definitions and Control field
  291.    encodings standardized in ISO 4335-1979 [4] and ISO 4335-
  292.    1979/Addendum 1-1979 [5].  PPP framing is also consistent with CCITT
  293.    Recommendation X.25 LAPB [6], and CCITT Recommendation Q.922 [7],
  294.    since those are also based on HDLC.
  295.  
  296.    The purpose of this specification is not to document what is already
  297.    standardized in ISO 3309.  It is assumed that the reader is already
  298.    familiar with HDLC, or has access to a copy of [2] or [6].  Instead,
  299.    this document attempts to give a concise summary and point out
  300.    specific options and features used by PPP.
  301.  
  302.    To remain consistent with standard Internet practice, and avoid
  303.    confusion for people used to reading RFCs, all binary numbers in the
  304.    following descriptions are in Most Significant Bit to Least
  305.    Significant Bit order, reading from left to right, unless otherwise
  306.    indicated.  Note that this is contrary to standard ISO and CCITT
  307.    practice which orders bits as transmitted (network bit order).  Keep
  308.    this in mind when comparing this document with the international
  309.    standards documents.
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333. Simpson                  expires in six months                  [Page 5]
  334. DRAFT                         PPP Framing                    August 1993
  335.  
  336.  
  337. 3.1.  Frame Format
  338.  
  339.    A summary of the PPP HDLC frame structure is shown below.  This
  340.    figure does not include start/stop bits (for asynchronous links), nor
  341.    any bits or octets inserted for transparency.  The fields are
  342.    transmitted from left to right.
  343.  
  344.            +----------+----------+----------+
  345.            |   Flag   | Address  | Control  |
  346.            | 01111110 | 11111111 | 00000011 |
  347.            +----------+----------+----------+
  348.            +----------+-------------+---------+
  349.            | Protocol | Information | Padding |
  350.            | 16 bits  |      *      |    *    |
  351.            +----------+-------------+---------+
  352.            +----------+----------+-----------------
  353.            |   FCS    |   Flag   | Inter-frame Fill
  354.            | 16 bits  | 01111110 | or next Address
  355.            +----------+----------+-----------------
  356.  
  357.    The Protocol, Information and Padding fields are described in the
  358.    Point-to-Point Protocol Encapsulation [1].
  359.  
  360.    Flag Sequence
  361.  
  362.       The Flag Sequence indicates the beginning or end of a frame, and
  363.       always consists of the binary sequence 01111110 (hexadecimal
  364.       0x7e).
  365.  
  366.       The Flag Sequence is a frame separator.  Only one Flag Sequence is
  367.       required between two frames.  Two consecutive Flag Sequences
  368.       constitute an empty frame, which is ignored, and not counted as a
  369.       FCS error.
  370.  
  371.    Address Field
  372.  
  373.       The Address field is a single octet and contains the binary
  374.       sequence 11111111 (hexadecimal 0xff), the All-Stations address.
  375.       PPP does not assign individual station addresses.  The All-
  376.       Stations address MUST always be recognized and received.  The use
  377.       of other address lengths and values may be defined at a later
  378.       time, or by prior agreement.  Frames with unrecognized Addresses
  379.       SHOULD be silently discarded, and reported through the normal
  380.       network management facility.
  381.  
  382.    Control Field
  383.  
  384.       The Control field is a single octet and contains the binary
  385.  
  386.  
  387.  
  388. Simpson                  expires in six months                  [Page 6]
  389. DRAFT                         PPP Framing                    August 1993
  390.  
  391.  
  392.       sequence 00000011 (hexadecimal 0x03), the Unnumbered Information
  393.       (UI) command with the P/F bit set to zero.  The use of other
  394.       Control field values may be defined at a later time, or by prior
  395.       agreement.  Frames with unrecognized Control field values SHOULD
  396.       be silently discarded.
  397.  
  398.    Frame Check Sequence (FCS) Field
  399.  
  400.       The Frame Check Sequence field is normally 16 bits (two octets).
  401.       The use of other FCS lengths may be defined at a later time, or by
  402.       prior agreement.  The FCS is transmitted with the coefficient of
  403.       the highest term first.
  404.  
  405.       The FCS field is calculated over all bits of the Address, Control,
  406.       Protocol, Information and Padding fields, not including any start
  407.       and stop bits (asynchronous) nor any bits (synchronous) or octets
  408.       (asynchronous) inserted for transparency.  This also does not
  409.       include the Flag Sequences or the FCS field itself.
  410.  
  411.          Note: When octets are received which are flagged in the Async-
  412.          Control-Character-Map, they are discarded before calculating
  413.          the FCS.
  414.  
  415.       For more information on the specification of the FCS, see ISO 3309
  416.       [2] or CCITT X.25 [6].
  417.  
  418.    The end of the Information and Padding fields is found by locating
  419.    the closing Flag Sequence and removing the Frame Check Sequence
  420.    field.
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443. Simpson                  expires in six months                  [Page 7]
  444. DRAFT                         PPP Framing                    August 1993
  445.  
  446.  
  447. 3.2.  Modification of the Basic Frame
  448.  
  449.    The Link Control Protocol can negotiate modifications to the basic
  450.    HDLC frame structure.  However, modified frames will always be
  451.    clearly distinguishable from standard frames.
  452.  
  453.    Address-and-Control-Field-Compression
  454.  
  455.       When using the default HDLC framing, the Address and Control
  456.       fields contain the hexadecimal values 0xff and 0x03 respectively.
  457.  
  458.       On transmission, compressed Address and Control fields are formed
  459.       by simply omitting them.
  460.  
  461.       On reception, the Address and Control fields are decompressed by
  462.       examining the first two octets.  If they contain the values 0xff
  463.       and 0x03, they are assumed to be the Address and Control fields.
  464.       If not, it is assumed that the fields were compressed and were not
  465.       transmitted.
  466.  
  467.       By definition, the first octet of a two octet Protocol field will
  468.       never be 0xff (since it is not even).  The Protocol field value
  469.       0x00ff is not allowed (reserved) to avoid ambiguity when
  470.       Protocol-Field-Compression is enabled and the first Information
  471.       field octet is 0x03.
  472.  
  473.       When other Address or Control field values are in use, Address-
  474.       and-Control-Field-Compression MUST NOT be negotiated.
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498. Simpson                  expires in six months                  [Page 8]
  499. DRAFT                         PPP Framing                    August 1993
  500.  
  501.  
  502. 4.  Asynchronous HDLC
  503.  
  504.    This section summarizes the use of HDLC with 8-bit asynchronous
  505.    links, as applied in the Point-to-Point Protocol.
  506.  
  507.    Transmission Considerations
  508.  
  509.       All octets are transmitted with one start bit, eight bits of data,
  510.       and one stop bit.  There is no provision for seven bit
  511.       asynchronous links.
  512.  
  513.    Flag Sequence
  514.  
  515.       The Flag Sequence indicates the beginning or end of a frame.  The
  516.       octet stream is examined on an octet-by-octet basis for the value
  517.       01111110 (hexadecimal 0x7e).
  518.  
  519.    Transparency
  520.  
  521.       On asynchronous links, an octet stuffing procedure is used.  The
  522.       Control Escape octet is defined as binary 01111101 (hexadecimal
  523.       0x7d) where the bit positions are numbered 87654321 (not 76543210,
  524.       BEWARE).
  525.  
  526.       Each end of the link maintains two Async-Control-Character-Maps.
  527.       The receiving ACCM is 32 bits, but the sending ACCM may be up to
  528.       256 bits.  This results in four distinct ACCMs, two in each
  529.       direction of the link.
  530.  
  531.       The default receiving ACCM is 0xffffffff.  The default sending
  532.       ACCM is 0xffffffff, plus the Control Escape and Flag Sequence
  533.       characters themselves, plus whatever other outgoing characters are
  534.       known to be intercepted.
  535.  
  536.       After FCS computation, the transmitter examines the entire frame
  537.       between the two Flag Sequences.  Each Flag Sequence, Control
  538.       Escape octet, and octet with value less than hexadecimal 0x20
  539.       which is flagged in the sending Async-Control-Character-Map, is
  540.       replaced by a two octet sequence consisting of the Control Escape
  541.       octet and the original octet with bit 6 complemented (exclusive-
  542.       or'd with hexadecimal 0x20).
  543.  
  544.       Prior to FCS computation, the receiver examines the entire frame
  545.       between the two Flag Sequences.  Each octet with value less than
  546.       hexadecimal 0x20 is checked.  If it is flagged in the receiving
  547.       Async-Control-Character-Map, it is simply removed (it may have
  548.       been inserted by intervening data communications equipment).  For
  549.       each Control Escape octet, that octet is also removed, but bit 6
  550.  
  551.  
  552.  
  553. Simpson                  expires in six months                  [Page 9]
  554. DRAFT                         PPP Framing                    August 1993
  555.  
  556.  
  557.       of the following octet is complemented, unless it is the Flag
  558.       Sequence.
  559.  
  560.          Note: The inclusion of all octets less than hexadecimal 0x20
  561.          allows all ASCII control characters [8] excluding DEL (Delete)
  562.          to be transparently communicated through all known data
  563.          communications equipment.
  564.  
  565.       The transmitter may also send octets with value in the range 0x40
  566.       through 0xff (except 0x5e) in Control Escape format.  Since these
  567.       octet values are not negotiable, this does not solve the problem
  568.       of receivers which cannot handle all non-control characters.
  569.       Also, since the technique does not affect the 8th bit, this does
  570.       not solve problems for communications links that can send only 7-
  571.       bit characters.
  572.  
  573.       A few examples may make this more clear.  Packet data is
  574.       transmitted on the link as follows:
  575.  
  576.          0x7e is encoded as 0x7d, 0x5e.
  577.          0x7d is encoded as 0x7d, 0x5d.
  578.          0x01 is encoded as 0x7d, 0x21.
  579.  
  580.       Some modems with software flow control may intercept outgoing DC1
  581.       and DC3 ignoring the 8th (parity) bit.  This data would be
  582.       transmitted on the link as follows:
  583.  
  584.          0x11 is encoded as 0x7d, 0x31.
  585.          0x13 is encoded as 0x7d, 0x33.
  586.          0x91 is encoded as 0x7d, 0xb1.
  587.          0x93 is encoded as 0x7d, 0xb3.
  588.  
  589.  
  590.    Aborting a Transmission
  591.  
  592.       On asynchronous links, frames may be aborted by transmitting a "0"
  593.       stop bit where a "1" bit is expected (framing error) or by
  594.       transmitting a Control Escape octet followed immediately by a
  595.       closing Flag Sequence.
  596.  
  597.    Time Fill
  598.  
  599.       For asynchronous links, inter-octet and inter-frame time fill MUST
  600.       be accomplished by transmitting continuous "1" bits (mark-hold
  601.       state).
  602.  
  603.       Inter-frame time fill can be viewed as extended inter-octet time
  604.       fill.  Doing so can save one octet for every frame, decreasing
  605.  
  606.  
  607.  
  608. Simpson                  expires in six months                 [Page 10]
  609. DRAFT                         PPP Framing                    August 1993
  610.  
  611.  
  612.       delay and increasing bandwidth.  This is possible since a Flag
  613.       Sequence may serve as both a frame close and a frame begin.  After
  614.       having received any frame, an idle receiver will always be in a
  615.       frame begin state.
  616.  
  617.       Robust transmitters should avoid using this trick over-zealously,
  618.       since the price for decreased delay is decreased reliability.
  619.       Noisy links may cause the receiver to receive garbage characters
  620.       and interpret them as part of an incoming frame.  If the
  621.       transmitter does not send a new opening Flag Sequence before
  622.       sending the next frame, then that frame will be appended to the
  623.       noise characters causing an invalid frame (with high reliability).
  624.       It is suggested that implementations will achieve the best results
  625.       by always sending an opening Flag Sequence if the new frame is not
  626.       back-to-back with the last.  Transmitters SHOULD send an open Flag
  627.       Sequence whenever "appreciable time" has elapsed after the prior
  628.       closing Flag Sequence.  The maximum value for "appreciable time"
  629.       is likely to be no greater than the typing rate of a slow typist,
  630.       say 1 second.
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663. Simpson                  expires in six months                 [Page 11]
  664. DRAFT                         PPP Framing                    August 1993
  665.  
  666.  
  667. 5.  Bit-synchronous HDLC
  668.  
  669.    This section summarizes the considerations for HDLC interoperability,
  670.    as applied in the Point-to-Point Protocol to bit-synchronous links.
  671.  
  672.    Flag Sequence
  673.  
  674.       The Flag Sequence indicates the beginning or end of a frame, and
  675.       is used for frame synchronization.  The bit stream is examined on
  676.       a bit-by-bit basis for the binary sequence 01111110 (hexadecimal
  677.       0x7e).
  678.  
  679.       The "shared zero mode" Flag Sequence "011111101111110" SHOULD NOT
  680.       be used.  When not avoidable, such an implementation MUST ensure
  681.       that the first Flag Sequence detected (the end of the frame) is
  682.       promptly communicated to the link layer.  Use of the shared zero
  683.       mode hinders interoperability with synchronous-to-asynchronous
  684.       converters.
  685.  
  686.    Transparency
  687.  
  688.       The transmitter examines the entire frame between the two Flag
  689.       Sequences.  A "0" bit is inserted after all sequences of five
  690.       contiguous "1" bits (including the last 5 bits of the FCS) to
  691.       ensure that a Flag Sequence is not simulated.
  692.  
  693.       When receiving, any "0" bit that directly follows five contiguous
  694.       "1" bits is discarded.
  695.  
  696.       Since the Control Escape octet-stuffing method is not used, the
  697.       default receiving and sending Async-Control-Character-Maps are 0.
  698.  
  699.       There may be some use of synchronous-to-asynchronous converters
  700.       (some built into modems) in point-to-point links resulting in a
  701.       synchronous PPP implementation on one end of a link and an
  702.       asynchronous implementation on the other.  It is the
  703.       responsibility of the converter to do all mapping conversions
  704.       during operation.  To enable this functionality, bit-synchronous
  705.       PPP implementations MUST always respond to the Async-Control-
  706.       Character-Map Configuration Option with an LCP Configure-Ack.
  707.       However, acceptance of the Configuration Option does not imply
  708.       that the bit-synchronous implementation will do any octet mapping.
  709.       Instead, all such octet mapping will be performed by the
  710.       asynchronous-to-synchronous converter.
  711.  
  712.    Aborting a Transmission
  713.  
  714.       A sequence of more than six "1" bits indicates an invalid frame,
  715.  
  716.  
  717.  
  718. Simpson                  expires in six months                 [Page 12]
  719. DRAFT                         PPP Framing                    August 1993
  720.  
  721.  
  722.       which is ignored, and not counted as a FCS error.
  723.  
  724.    Inter-frame Time Fill
  725.  
  726.       For bit-synchronous links, the Flag Sequence SHOULD be transmitted
  727.       during inter-frame time fill.  There is no provision for inter-
  728.       octet time fill.
  729.  
  730.       Mark idle (continuous ones) SHOULD NOT be used for inter-frame
  731.       time fill.  However, certain types of circuit-switched links
  732.       require the use of mark idle, particularly those that calculate
  733.       accounting based on periods of bit activity.  When mark idle is
  734.       used on a bit-synchronous link, the implementation MUST ensure at
  735.       least 15 consecutive "1" bits between Flags during the idle
  736.       period, and that the Flag Sequence is always generated at the
  737.       beginning of a frame after an idle period.
  738.  
  739.    Encoding
  740.  
  741.       PPP does not require any particular bit-synchronous encoding, such
  742.       as FM, NRZ, or NRZI.  The use of various encodings and scrambling
  743.       is the responsibility of the DTE/DCE equipment in use, and is
  744.       outside the scope of this specification.
  745.  
  746.       While PPP will operate without regard to the underlying
  747.       representation of the octet stream, lack of standards for
  748.       transmission will hinder interoperability as surely as lack of
  749.       data link standards.  At speeds of 56 Kbps through 2.0 Mbps, NRZ
  750.       is currently most widely available, and on that basis is
  751.       recommended as a default.
  752.  
  753.       When some configuration of the encoding is allowed, NRZI is
  754.       recommended as an alternative, because of its relative immunity to
  755.       signal inversion configuration errors, and instances when it MAY
  756.       allow connection without an expensive DSU/CSU.  Unfortunately,
  757.       NRZI encoding obviates the (1 + x) factor of the 16-bit FCS, so
  758.       that one error in 2**15 goes undetected (instead of one in 2**16),
  759.       and triple errors are not detected.  Therefore, when NRZI is in
  760.       use, it is recommended that the 32-bit FCS be negotiated, which
  761.       does not include the (1 + x) factor.
  762.  
  763.       At higher speeds of up to 45 Mbps, some implementors have chosen
  764.       the ANSI High Speed Synchronous Interface [HSSI].  While this
  765.       experience is currently limited, implementors are encouraged to
  766.       cooperate in choosing transmission encoding.
  767.  
  768.       At speeds of greater than 45 Mbps, it is expected that octet-
  769.       synchronous links such as SONET will be used.
  770.  
  771.  
  772.  
  773. Simpson                  expires in six months                 [Page 13]
  774. DRAFT                         PPP Framing                    August 1993
  775.  
  776.  
  777. A.  Fast Frame Check Sequence (FCS) Implementation
  778.  
  779.    The FCS was originally designed with hardware implementations in
  780.    mind.  A serial bit stream is transmitted on the wire, the FCS is
  781.    calculated over the serial data as it goes out, and the complement of
  782.    the resulting FCS is appended to the serial stream, followed by the
  783.    Flag Sequence.
  784.  
  785.    The receiver has no way of determining that it has finished
  786.    calculating the received FCS until it detects the Flag Sequence.
  787.    Therefore, the FCS was designed so that a particular pattern results
  788.    when the FCS operation passes over the complemented FCS.  A good
  789.    frame is indicated by this "good FCS" value.
  790.  
  791.  
  792. A.1.  FCS Computation Method
  793.  
  794.    The following code provides a table lookup computation for
  795.    calculating the Frame Check Sequence as data arrives at the
  796.    interface.  This implementation is based on [9], [10], and [11].  The
  797.    table is created by the code in section B.2.
  798.  
  799.    /*
  800.     * u16 represents an unsigned 16-bit number.  Adjust the typedef for
  801.     * your hardware.
  802.     */
  803.    typedef unsigned short u16;
  804.  
  805.  
  806.    /*
  807.     * FCS lookup table as calculated by the table generator in section B.2.
  808.     */
  809.    static u16 fcstab[256] = {
  810.       0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
  811.       0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
  812.       0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
  813.       0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
  814.       0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
  815.       0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
  816.       0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
  817.       0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
  818.       0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
  819.       0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
  820.       0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
  821.       0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
  822.       0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
  823.       0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
  824.       0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
  825.  
  826.  
  827.  
  828. Simpson                  expires in six months                 [Page 14]
  829. DRAFT                         PPP Framing                    August 1993
  830.  
  831.  
  832.       0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
  833.       0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
  834.       0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
  835.       0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
  836.       0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
  837.       0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
  838.       0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
  839.       0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
  840.       0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
  841.       0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
  842.       0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
  843.       0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
  844.       0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
  845.       0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
  846.       0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
  847.       0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
  848.       0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
  849.    };
  850.  
  851.    #define PPPINITFCS16    0xffff  /* Initial FCS value */
  852.    #define PPPGOODFCS16    0xf0b8  /* Good final FCS value */
  853.  
  854.    /*
  855.     * Calculate a new fcs given the current fcs and the new data.
  856.     */
  857.    u16 pppfcs16(fcs, cp, len)
  858.        register u16 fcs;
  859.        register unsigned char *cp;
  860.        register int len;
  861.    {
  862.        ASSERT(sizeof (u16) == 2);
  863.        ASSERT(((u16) -1) > 0);
  864.        while (len--)
  865.            fcs = (fcs >> 8) ^ fcstab[(fcs ^ *cp++) & 0xff];
  866.  
  867.        return (fcs);
  868.    }
  869.  
  870.    /*
  871.     * How to use the fcs
  872.     */
  873.    tryfcs16(cp, len)
  874.        register unsigned char *cp;
  875.        register int len;
  876.    {
  877.        u16 trialfcs;
  878.  
  879.        /* add on output */
  880.  
  881.  
  882.  
  883. Simpson                  expires in six months                 [Page 15]
  884. DRAFT                         PPP Framing                    August 1993
  885.  
  886.  
  887.        trialfcs = pppfcs16( PPPINITFCS16, cp, len );
  888.        trialfcs ^= 0xffff;                 /* complement */
  889.        cp[len] = (trialfcs & 0x00ff);      /* least significant byte first */
  890.        cp[len+1] = ((trialfcs >> 8) & 0x00ff);
  891.  
  892.        /* check on input */
  893.        trialfcs = pppfcs16( PPPINITFCS16, cp, len + 2 );
  894.        if ( trialfcs == PPPGOODFCS16 )
  895.            printf("Good FCS\n");
  896.    }
  897.  
  898.  
  899. A.2.  Fast FCS table generator
  900.  
  901.    The following code creates the lookup table used to calculate the
  902.    FCS.
  903.  
  904.    /*
  905.     * Generate a FCS table for the HDLC FCS.
  906.     *
  907.     * Drew D. Perkins at Carnegie Mellon University.
  908.     *
  909.     * Code liberally borrowed from Mohsen Banan and D. Hugh Redelmeier.
  910.     */
  911.  
  912.    /*
  913.     * The HDLC polynomial: x**0 + x**5 + x**12 + x**16 (0x8408).
  914.     */
  915.    #define P       0x8408
  916.  
  917.  
  918.    main()
  919.    {
  920.        register unsigned int b, v;
  921.        register int i;
  922.  
  923.        printf("typedef unsigned short u16;\n");
  924.        printf("static u16 fcstab[256] = {");
  925.        for (b = 0; ; ) {
  926.            if (b % 8 == 0)
  927.                printf("\n");
  928.  
  929.            v = b;
  930.            for (i = 8; i--; )
  931.                v = v & 1 ? (v >> 1) ^ P : v >> 1;
  932.  
  933.            printf("\t0x%04x", v & 0xFFFF);
  934.            if (++b == 256)
  935.  
  936.  
  937.  
  938. Simpson                  expires in six months                 [Page 16]
  939. DRAFT                         PPP Framing                    August 1993
  940.  
  941.  
  942.                break;
  943.            printf(",");
  944.        }
  945.        printf("\n};\n");
  946.    }
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993. Simpson                  expires in six months                 [Page 17]
  994. DRAFT                         PPP Framing                    August 1993
  995.  
  996.  
  997. Security Considerations
  998.  
  999.    As noted in the Physical Layer Requirements section, the link layer
  1000.    might not be informed when the connected state of physical layer is
  1001.    changed.  This results in possible security lapses due to over-
  1002.    reliance on the integrity and security of switching systems and
  1003.    administrations.  An insertion attack might be undetected.  An
  1004.    attacker which is able to spoof the same calling identity might be
  1005.    able to avoid link authentication.
  1006.  
  1007.  
  1008. References
  1009.  
  1010.    [1]   Simpson, W. A., "The Point-to-Point Protocol (PPP)", work in
  1011.          progress.
  1012.  
  1013.    [2]   International Organization For Standardization, ISO Standard
  1014.          3309-1979, "Data communication - High-level data link control
  1015.          procedures - Frame structure", 1979.
  1016.  
  1017.    [3]   International Organization For Standardization, Proposed Draft
  1018.          International Standard ISO 3309:1983/PDAD1, "Information
  1019.          processing systems - Data communication - High-level data link
  1020.          control procedures - Frame structure - Addendum 1: Start/stop
  1021.          transmission", 1984.
  1022.  
  1023.    [4]   International Organization For Standardization, ISO Standard
  1024.          4335-1979, "Data communication - High-level data link control
  1025.          procedures - Elements of procedures", 1979.
  1026.  
  1027.    [5]   International Organization For Standardization, ISO Standard
  1028.          4335-1979/Addendum 1, "Data communication - High-level data
  1029.          link control procedures - Elements of procedures - Addendum 1",
  1030.          1979.
  1031.  
  1032.    [6]   International Telecommunication Union, CCITT Recommendation
  1033.          X.25, "Interface Between Data Terminal Equipment (DTE) and Data
  1034.          Circuit Terminating Equipment (DCE) for Terminals Operating in
  1035.          the Packet Mode on Public Data Networks", CCITT Red Book,
  1036.          Volume VIII, Fascicle VIII.3, Rec. X.25., October 1984.
  1037.  
  1038.    [7]   International Telegraph and Telephone Consultative Committee,
  1039.          CCITT Recommendation Q.922, "ISDN Data Link Layer Specification
  1040.          for Frame Mode Bearer Services", April 1991.
  1041.  
  1042.    [8]   American National Standards Institute, ANSI X3.4-1977,
  1043.          "American National Standard Code for Information Interchange",
  1044.          1977.
  1045.  
  1046.  
  1047.  
  1048. Simpson                  expires in six months                 [Page 18]
  1049. DRAFT                         PPP Framing                    August 1993
  1050.  
  1051.  
  1052.    [9]   Perez, "Byte-wise CRC Calculations", IEEE Micro, June, 1983.
  1053.  
  1054.    [10]  Morse, G., "Calculating CRC's by Bits and Bytes", Byte,
  1055.          September 1986.
  1056.  
  1057.    [11]  LeVan, J., "A Fast CRC", Byte, November 1987.
  1058.  
  1059.  
  1060. Acknowledgments
  1061.  
  1062.    This specification is based on previous RFCs, where many
  1063.    contributions have been acknowleged.
  1064.  
  1065.    Additional implementation detail for this version was provided by
  1066.    Fred Baker (ACC), Craig Fox (NSC), and Phil Karn (Qualcomm).
  1067.  
  1068.    Special thanks to Morning Star Technologies for providing computing
  1069.    resources and network access support for writing this specification.
  1070.  
  1071.  
  1072. Chair's Address
  1073.  
  1074.    The working group can be contacted via the current chair:
  1075.  
  1076.       Fred Baker
  1077.       Advanced Computer Communications
  1078.       315 Bollay Drive
  1079.       Santa Barbara, California, 93111
  1080.  
  1081.       EMail: fbaker@acc.com
  1082.  
  1083.  
  1084. Editor's Address
  1085.  
  1086.    Questions about this memo can also be directed to:
  1087.  
  1088.       William Allen Simpson
  1089.       Daydreamer
  1090.       Computer Systems Consulting Services
  1091.       1384 Fontaine
  1092.       Madison Heights, Michigan  48071
  1093.  
  1094.       EMail: Bill.Simpson@um.cc.umich.edu
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103. Simpson                  expires in six months                 [Page 19]
  1104. DRAFT                         PPP Framing                    August 1993
  1105.  
  1106.  
  1107.                            Table of Contents
  1108.  
  1109.  
  1110.      1.     Introduction ..........................................    1
  1111.         1.1       Specification of Requirements ...................    1
  1112.         1.2       Terminology .....................................    2
  1113.  
  1114.      2.     Physical Layer Requirements ...........................    3
  1115.  
  1116.      3.     The Data Link Layer ...................................    5
  1117.         3.1       Frame Format ....................................    6
  1118.         3.2       Modification of the Basic Frame .................    8
  1119.  
  1120.      4.     Asynchronous HDLC .....................................    9
  1121.  
  1122.      5.     Bit-synchronous HDLC ..................................   12
  1123.  
  1124.      APPENDICES ...................................................   14
  1125.  
  1126.      A.     Fast Frame Check Sequence (FCS) Implementation ........   14
  1127.         A.1       FCS Computation Method ..........................   14
  1128.         A.2       Fast FCS table generator ........................   16
  1129.  
  1130.      SECURITY CONSIDERATIONS ......................................   18
  1131.  
  1132.      REFERENCES ...................................................   18
  1133.  
  1134.      ACKNOWLEDGEMENTS .............................................   19
  1135.  
  1136.      CHAIR'S ADDRESS ..............................................   19
  1137.  
  1138.      EDITOR'S ADDRESS .............................................   19
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.